package com.peakmain.wanandroid.mymodule.helper;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

/**
 * author: peakmain
 * createdata：2019/7/29
 * mail: 2726449200@qq.com
 * desiption:
 */
public class CardItemTouchCallBack extends ItemTouchHelper.SimpleCallback{
    private CardItemHelper mCardItemHelper;
    public CardItemTouchCallBack(CardItemHelper helper) {
        super(0, ItemTouchHelper.RIGHT | ItemTouchHelper.LEFT | ItemTouchHelper.DOWN);
        this.mCardItemHelper=helper;
    }

    @Override
    public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder viewHolder1) {
        return false;
    }

    @Override
    public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
       mCardItemHelper.onSwiped(viewHolder,direction);
    }
}
